package com.project.util;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

public class MessageCall {
	
	public MessageCall()
	{
		
	}
	
	public static void errorMessage(String message,String toComponent)
	{
		FacesMessage messages = new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message);
		FacesContext.getCurrentInstance().addMessage(toComponent, messages);
	}
	
	public static void infoMessage(String message,String toComponent)
	{
		FacesMessage messages = new FacesMessage(FacesMessage.SEVERITY_INFO, message, message);
		FacesContext.getCurrentInstance().addMessage(toComponent, messages);
	}
}
